package com.thor.palmmall.rest.order.converter;

import org.springframework.core.convert.converter.Converter;

import com.thor.palmmall.rest.order.AProductCategory;
import com.thor.palmmall.spi.order.SProductCategory;

public class AProductCategoryConverter implements Converter<SProductCategory,AProductCategory>{
	private static AProductCategoryConverter instance;
	public static AProductCategoryConverter getInstance() {
		if (instance == null)
			instance = new AProductCategoryConverter();
		return instance;
	}
	@Override
	public AProductCategory convert(SProductCategory source) {
		if (source == null){
		    return null;
		}
		AProductCategory target = new AProductCategory();
		target.setUuid(source.getUuid());
		target.setCode(source.getCode());
		target.setName(source.getName());
		target.setLevelId(source.getLevelId());
		return target;
	}

}
